import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
     //1.得到Spring
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
     //2.从Spring容器中获取到bean对象（方法一）
       /* Student student = (Student) context.getBean("student");*/
        //方法二
        Student student = context.getBean(Student.class);
        //方法三
        Student student1 = context.getBean("student",Student.class);
     //3.使用bean
        student.test();
    }
}
